from enum import Enum, unique, EnumMeta


class EnumDict:

    @staticmethod
    def transform(enum_class: EnumMeta):
        res = dict()
        for key, value in enum_class.__members__.items():
            res[key] = value.value
        return res

    @staticmethod
    def reverse_transform(enum_class: EnumMeta):
        res = dict()
        for key, value in enum_class.__members__.items():
            res[value.value] = key
        return res


@unique
class MaintenanceEnum(Enum):
    p1 = "发起授权申请"
    p2 = "绑定授权码"
    p3 = "作废授权码。作废原因："
    p4 = "发起迁移申请"


if __name__ == '__main__':
    z = EnumDict.transform(MaintenanceEnum)
    print(z)

    z = EnumDict.reverse_transform(MaintenanceEnum)
    print(z)

    s = lambda x, y=1: [i for i in x if i > y]

    print(s([0, 1, 2, 3, 4, 5]))

